<?php
Class RssController{
public $title;
public $layout;
   
	public function __construct(){
		$this->layout = 'false';
	}

    public function IndexAction(){
		//$this->content = ORM::factory()->SetType('object')->Select('razdel.title, razdel.url, content.body')->Where(array('razdel.razdel'=>2, 'razdel.id'=>'content.razdel'))->crossjoin('razdel, content')->find_all();
		$this->pages = ORM::factory()->SetType('assoc')->prepare("SELECT razdel.title, razdel.url, CONCAT(SUBSTR(content.body, 1, 2048)) as `body` FROM `razdel`, `content` WHERE razdel.id=content.razdel ORDER BY razdel.id DESC LIMIT 20")->getResult();
		//$this->info = ORM::factory()->SetType('assoc')->prepare("SELECT razdel.title, razdel.url, CONCAT(SUBSTR(content.body, 1, 2048)) as `body` FROM `razdel`, `content` WHERE razdel.razdel=9 AND razdel.id=content.razdel")->getResult();
		$this->tovar = ORM::factory()->SetType('assoc')->prepare("SELECT goods.url, goods.name, goods.descrip, CetegoryTovar.url as `group`, GroupTovar.url as `cat`  FROM `goods`, `CetegoryTovar`, `GroupTovar` WHERE goods.Cat=CetegoryTovar.id AND CetegoryTovar.group=GroupTovar.id LIMIT 20")->getResult();
    }
}
